<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/11/27
 * Time: 14:27
 */
require("Include/conn.php");

global $link;

if(isset($_COOKIE['user_id'])&&is_numeric($_COOKIE['user_id'])){
    $user_id = $_COOKIE['user_id'];
    $pic_id = $_GET["pic_id"];

    $sql = "UPDATE `pw_pic` SET `pic_stat`=0 WHERE `pic_id`=$pic_id AND `pic_userid`=$user_id;";

    $result = mysqli_query($link,$sql);

    header("location:http://localhost/mark/user.php");
}
else{
    header('location: http://localhost/mark/login.php');
}


?>